/*River Warren
 *October 7, 2011
 *
 *Room.h
 *Room object to be used by the game Dungeons and Princesses
 *Room has a door object as well various other possible objects
 *including but not limited to: Keys, treasure, monsters, weapons, other equipment and princesses.
 *room has a description which includes
    descriptions of the view in four directions
    description of any doors
    description of any objects in the room
 *Room allows movement from one room to another in accordence with house plot in docs.
 *Room for new game is R0
*/

#ifndef ROOM_H_INCLUDED
#define ROOM_H_INCLUDED

#include "Door.h"
#include <fstream>
#include <ostream>
#include <istream>
#include <string.h>

#define DELIMS ",\n"
#define MAX 250

#include <iostream>
#include "base.h"

using std::string;
using std::ofstream;
using std::endl;
using std::ifstream;

class Room
{
    public:
        Room();
        ~Room();
        //Inventory inv; ***************************************************//to be implemented
        string getDesc();//get description of room

        //mgetLink to next room
        //must be contained within try catch block
        string getLink(int);
        bool unlockDoor(string);//unlock door with proper key Id else throws exception
        string getObjectID(){return objectID;}
        void loadRoom(string);//loads new room
        void saveRoom();//writes new room state to file
        bool hasDoor(){return has_door;}
        string getKeyCode();//returns key code for opening door
    protected:
    private:
        string objectID;//a unique objectID value
        string linkArray[4];//an array to hold the links
        string NorthLink;//either null or file to north of this
        string EastLink;//either null or file to east of this
        string SouthLink;//either null or file to south of this
        string WestLink;//either null or file to west of this
        string descArray[5];//and array to hold the descriptions
        string description;//general description of room
        string N_desc;//description of what is to the north
        string E_desc;//description of what is to the east
        string S_desc;//description of what is to the south
        string W_desc;//description of what is to the west
        int has_door;//0 if there is no door, 1 if door is to north, 2 if east, ect.
        Door d;//door object.

};

#endif // ROOM_H_INCLUDED
